package com.flying.admin.manage;

import com.flying.admin.service.ModuleDeploy;
import com.flying.framework.annotation.MethodInfo;
import com.flying.framework.annotation.Param;
import com.flying.framework.annotation.Service;
import com.flying.framework.data.Data;
import com.flying.framework.service.AbstractService;

@Service("MonitorService")
public class MonitorService extends AbstractService {
	private ModuleDeploy moduleDeploy;
	
	public void setModuleDeploy(ModuleDeploy md) {
		this.moduleDeploy = md;
	}
	
	@MethodInfo("安装通知֪")
	public Data installNotice(
			@Param(value="appId",             required=true,	desc="应用ID") String appId,
			@Param(value="moduleId",          required=true,	desc="模块ID") String moduleId,
			@Param(value="version",           required=true,	desc="版本号") String version,
			@Param(value="hostName",          required=true,	desc="所属主机名称") String hostName,
			@Param(value="hostAddress",       required=true,	desc="所属主机IP") String hostAddress,
			@Param(value="path",              required=true,	desc="模块安装目录") String path) throws Exception {
		
		return this.moduleDeploy.deploy(appId, moduleId, version, hostName, hostAddress, path);
	}
	
	@MethodInfo("卸载通知֪")
	public Data uninstallNotice(
			@Param(value="appId", required=true, desc="应用ID") String appId,
			@Param(value="moduleId", required=true, desc="模块ID") String moduleId) throws Exception {
		return null;
	}
	
	@MethodInfo("心跳请求")
	public Data hello(
			@Param(value="appId", required=true, desc="应用ID") String appId,
			@Param(value="moduleId", required=true, desc="模块ID") String moduleId) throws Exception {
		return null;
	}
}
